Skip to content

fix(stv): 90 s WebRTC join timeout default; report a connection closed before sessionReady - #31

Merged
sqrt-negativeone merged 2 commits into
mainfrom
fix/webrtc-session-ready-wait
Oct 1, 2026
Merged

sqrt-negativeone merged 2 commits into
mainfrom
fix/webrtc-session-ready-wait

Conversation

@sqrt-negativeone

@sqrt-negativeone sqrt-negativeone commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Two problems with how a direct-WebRTC session waits for sessionReady.

The default timeout was too short. WebRTCSettings.webrtc_join_timeout_s defaulted to 10 s, but the wait covers the model's cold start as well as the room join, and a cold start alone can take more than 30 s. The default failed sessions the server was about to start. It is now 90 s. An explicit value still wins.

A connection closed before sessionReady was not reported. When the server closed without sending an errorResponse (for example a failed entitlement check closing with 1008 Insufficient funds), the WebSocket client waited forever and the WebRTC client waited out the whole join timeout, then blamed a timeout. OjinClient now queues an error with code CONNECTION_CLOSED and the close code and reason, so both clients emit a fatal ERROR at once. A server errorResponse followed by a close still reports only the server's error.

Also:

  • The WEBRTC_JOIN_TIMEOUT message starts with Timed out:.
  • README, the integration skill and examples/03-direct-webrtc (which hard-coded 30 s) follow the new default.

Release

Bumps ojin-client to 0.12.1; the entries are under 0.12.1 in CHANGELOG.md. Merging publishes it to PyPI.

Verification

  • uv run ruff format --check ., uv run ruff check ., uvx ruff check --select F,E9 examples: clean.
  • uv run pytest: 293 passed.
  • uvx pyright: 2 errors, both in entities/interaction_messages.py, which this PR does not touch.
  • Not exercised against a live server.

🤖 Generated with Claude Code

sqrt-negativeone and others added 2 commits October 1, 2026 14:14
… timeout default

A direct-WebRTC session failed to wait long enough for sessionReady. The
``webrtc_join_timeout_s`` default of 10 s covered only the room join; the model's
cold start alone can exceed 30 s, so most first sessions timed out. The default is
now 90 s, and the README, example, and skill docs are updated. When the server
closes the WebSocket before sending sessionReady without an errorResponse (e.g. a
failed entitlement check), the client now queues a CONNECTION_CLOSED error with the
WebSocket close code and reason instead of waiting silent until timeout.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The WebRTC join timeout default (90s) and connection-close-before-sessionReady
reporting fix the integration in fix/webrtc-session-ready-wait. Automated
publishing requires a version bump to deploy these changes to production.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@sqrt-negativeone
sqrt-negativeone merged commit 7c24c6a into main Oct 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant